UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gLRZhZFaGbyIaKD8X4lP9xQEjmDJAAyjPeQT85UMg4w=' 
WHERE 
  key_id = '5bfb134a79c46b159e405ff8ddd4084a8a8a3ca315d884ccbd86c17cde73eb2f' 
  AND (
    token = 'gLRZhZFaGbyIaKD8X4lP9xQEjmDJAAyjPeQT85UMg4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046