UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lwjV7EUHiM1eSJq37pTBBQUe/49cKzluEZDD99aPj+Y='
WHERE
key_id = 'b6107e7f14e9d06c440d8fcc28b6fc6759fa67f9a4252ff605713e60ecd8d7f7'
AND (
token = 'lwjV7EUHiM1eSJq37pTBBQUe/49cKzluEZDD99aPj+Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)