UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GvhRLAvbrVj3OW39bBTAQMoP1KBea+pn5Z0bR2TLlbY='
WHERE
key_id = '8018863e5451ddfb8bcf1722eed2b4741076268d3919a6d52057f4e13ebdee9e'
AND (
token = 'GvhRLAvbrVj3OW39bBTAQMoP1KBea+pn5Z0bR2TLlbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)