UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6xEzj9bgLpGO/F3qAARf+a2nnS43ba/oiikvz/M0/70='
WHERE
key_id = '3e092a02c28b2f7737d44d1db3bcbc07f28b4ec8f786a02854d44765f30a0e41'
AND (
token = '6xEzj9bgLpGO/F3qAARf+a2nnS43ba/oiikvz/M0/70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)