UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1hK+WfkQ5lUIV292H6RRPWxPCTl0QwyQgXXC02g9X90='
WHERE
key_id = 'c1aba7a1c871666daec0fc75aef102564614c7dd55b63d2d86a2bcd994ecc788'
AND (
token = '1hK+WfkQ5lUIV292H6RRPWxPCTl0QwyQgXXC02g9X90='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)