UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U0ZgPE72uFSkg+T7eQxfoqFJoA261i9N/kEp+2Xa0sA='
WHERE
key_id = '607911d2b39369e65e71b4606b149d6df201aa208f117bf0775dbf072925402e'
AND (
token = 'U0ZgPE72uFSkg+T7eQxfoqFJoA261i9N/kEp+2Xa0sA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)