UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/iiTkDNYujVxG8quSIiHfFtqJ098DcSDn7+eoKbJEO4='
WHERE
key_id = '39e7f1bcfe315dc9ef6397bc135f333953b798363593209c2000dde41bed031d'
AND (
token = '/iiTkDNYujVxG8quSIiHfFtqJ098DcSDn7+eoKbJEO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)