UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yy2jRyr212zjGJTI3AWR9+uxgSos6U18BgkruqqCmdA='
WHERE
key_id = '601682d7838efe8a44ca1b9679b9ae9326dc2d95f1998017cb42160dacfd339a'
AND (
token = 'yy2jRyr212zjGJTI3AWR9+uxgSos6U18BgkruqqCmdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)