UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's2fj7sOZnP4y4eYMChlrpZ4yyHQzezCWwW/mnWmuUGA='
WHERE
key_id = '439361b7b8bfe5987095384ee277a3bf320ef65905d36d4135c3739e9bc0c2fa'
AND (
token = 's2fj7sOZnP4y4eYMChlrpZ4yyHQzezCWwW/mnWmuUGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)