UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MfwzZm8poOw/3G6wspf2Uzpo5osrrkoR6UYU2Kn90r4='
WHERE
key_id = 'fcb160f87f83079bd5417a912385920a73ba2eafc4d91e0521ad3c43ffafa1b9'
AND (
token = 'MfwzZm8poOw/3G6wspf2Uzpo5osrrkoR6UYU2Kn90r4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)