UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lQ7mfhhhl/mZvbBCZDagPBK7mqt4KCBxD/BgrqEBenY=' 
WHERE 
  key_id = 'b73655fcd8ebc0acc7777d260e4bbd3d70586dcd6e0a154a47adfe33c96b98f4' 
  AND (
    token = 'lQ7mfhhhl/mZvbBCZDagPBK7mqt4KCBxD/BgrqEBenY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046