UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uqpLa+Gp/uO29cyMuRHC/joPe44ECv6FyM+Txm3sdsU='
WHERE
key_id = '8403108d4ad405858ba20a4ebadc912572ac79ac0c5db78926885cf1f572162f'
AND (
token = 'uqpLa+Gp/uO29cyMuRHC/joPe44ECv6FyM+Txm3sdsU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)