UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b8KkL6jiL5cjRGJdvvUw4PmFpqkS691Y0Sh6rjtBnEg=' 
WHERE 
  key_id = '247aa43bb9b6f404fac66a6342ff9f2d1df75c2d2224d2d8ea1126a9a68df241' 
  AND (
    token = 'b8KkL6jiL5cjRGJdvvUw4PmFpqkS691Y0Sh6rjtBnEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020