UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oiCbhY7i9mtjpGMcra+8+4hWm8/sbzljB1hNXgd0MQA=' 
WHERE 
  key_id = '23ff57f619ffb39908ce57bc081399ce2b72efb956bfdbaa5cc58325c5329d90' 
  AND (
    token = 'oiCbhY7i9mtjpGMcra+8+4hWm8/sbzljB1hNXgd0MQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027