UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AnPX/pMnaJTwQMocfT1aqYbC4ZDleylclfvj/ndDHQg=' 
WHERE 
  key_id = '85e1b0307af77c4de8d8c67e4352ffde50e516a0c2fb62ec9496fd00f9d3202f' 
  AND (
    token = 'AnPX/pMnaJTwQMocfT1aqYbC4ZDleylclfvj/ndDHQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024