UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QGypaHFnZxOfy7CyZgs1Fu7L4VasIpPLfAEi/tlgoGA=' 
WHERE 
  key_id = '8fed8cb27830e391fbd830f1255cf9cef38a3cfbdc89817f94544a4c70f4ad15' 
  AND (
    token = 'QGypaHFnZxOfy7CyZgs1Fu7L4VasIpPLfAEi/tlgoGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020