UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rjQ5IT6rjBwlqpDtEwBT/6SIwa5vKrZrh6X+qsOW4dw='
WHERE
key_id = 'c8845594903afd1ddbf763af4b90f8e46b80e66f9b305c463553de28852c4c88'
AND (
token = 'rjQ5IT6rjBwlqpDtEwBT/6SIwa5vKrZrh6X+qsOW4dw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)