UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n0JvFluSGWmdnMMlbTV+Hl3bOueh1YxGppjmu5BD784='
WHERE
key_id = '9aeedf36e989c262b9dccbab479f57d090e51e8bbd329c8547117536832b44c6'
AND (
token = 'n0JvFluSGWmdnMMlbTV+Hl3bOueh1YxGppjmu5BD784='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)