UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JE8gTM3qPtnoiPz1guxTw1aHDYh9O5ALoG/6JM8GizE=' 
WHERE 
  key_id = '95fffec4ea947eb16b4be9dbb4de966cc90311a52f94c8c8b83d21e7f87a5983' 
  AND (
    token = 'JE8gTM3qPtnoiPz1guxTw1aHDYh9O5ALoG/6JM8GizE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037