UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x7iu3GDFLqgFlQ+uFOhKBVZUQvdTnCa8lU5Z/Dip+I0=' 
WHERE 
  key_id = '3eac170e1c1f4cbbf6461ff3fbf3a7759d36015fbed0e3d716456eac955cdc2e' 
  AND (
    token = 'x7iu3GDFLqgFlQ+uFOhKBVZUQvdTnCa8lU5Z/Dip+I0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027