UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y+x3dme3tXePcejxsyQFGto5nMohWqEJvwU1MKOZM5g='
WHERE
key_id = '7a7ebff7e6a1cb1841a8b52098b3ef26db07dc71b3fe2172313219f1391fb2e7'
AND (
token = 'Y+x3dme3tXePcejxsyQFGto5nMohWqEJvwU1MKOZM5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)