UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XXMQvM6wWU+zjShQ0rrIF9QsSSgNNieEB/sj1VS2j3U='
WHERE
key_id = '1562d9fc960a71bde3cd9c79191a1c1efaf912f2f488dc7b5275ae6578769591'
AND (
token = 'XXMQvM6wWU+zjShQ0rrIF9QsSSgNNieEB/sj1VS2j3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)