UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zt9OwMVHq/MMIkvUOMDyJI/aBbccphwWnTJ7zlt7wec='
WHERE
key_id = '51a0881f4df9c588c9e0fa13b021069ca4cc23a5e5a66e02c8b20ed0c8aaeba8'
AND (
token = 'Zt9OwMVHq/MMIkvUOMDyJI/aBbccphwWnTJ7zlt7wec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)