UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4FVe5kR5qMCnRCY0TrWMzb7McBZ0PqaHcUWcYa0Kj64='
WHERE
key_id = '6eb1ff452f17c513c7f3667d4fae6fcaddc2520bcc7540f159bd45cf0615f6ce'
AND (
token = '4FVe5kR5qMCnRCY0TrWMzb7McBZ0PqaHcUWcYa0Kj64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)