UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e2AqFz/+BSSfWgd+wJL2Wr9cq9+2QfUD7UpxB6OeZok='
WHERE
key_id = '6809686fb2019cdb7f9beb316098b56c6cda9d68acc340c624a76f1aefeca44b'
AND (
token = 'e2AqFz/+BSSfWgd+wJL2Wr9cq9+2QfUD7UpxB6OeZok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)