UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j5acfMOs0Pq4zleQNJyvDVPK2uXw9CkopC+GgGyiL0U='
WHERE
key_id = 'dca59c4a0890a092fea3379102cf5703fb55a07c07f994f87ac6edae11ef3c31'
AND (
token = 'j5acfMOs0Pq4zleQNJyvDVPK2uXw9CkopC+GgGyiL0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)