UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NkDrEeOKfD+T24kImnSHE3cIZahbyfqCR0arL3QlsGQ='
WHERE
key_id = '48113c6a91398d6592d325238c5ae2cfba0ecdcf52828e2c1c2706b4300d9ceb'
AND (
token = 'NkDrEeOKfD+T24kImnSHE3cIZahbyfqCR0arL3QlsGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)