UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TgegsYYkVQxlYaIvxRNoa1qKjrSoEe0IawWme9lQpr8='
WHERE
key_id = 'ed6532cf1c3022f238b928c6321058fb610b4b8bc217ad5ae2ca02dc65580870'
AND (
token = 'TgegsYYkVQxlYaIvxRNoa1qKjrSoEe0IawWme9lQpr8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)