UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nz1LO9aWVPCSfOwCtw798Flp5DgEx+LoYeujpbpybX0='
WHERE
key_id = '8c2da38d94fee510a38666d4ba9f2b4beef11bfb6aad7e1fe4c097065b081b6b'
AND (
token = 'Nz1LO9aWVPCSfOwCtw798Flp5DgEx+LoYeujpbpybX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)