UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'akngHmgWvzL3jFLx9buatMcNMs88M07iK+AEA4QIqcE='
WHERE
key_id = 'cf1c1d7514880589b58afac5f9b0439e691530d5900194f0048f04d8e138e8b9'
AND (
token = 'akngHmgWvzL3jFLx9buatMcNMs88M07iK+AEA4QIqcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)