UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e11Vgze2OAzKGg9VnhQXGKV5wKdsJ5XxHXlvBIWv2M8=' 
WHERE 
  key_id = '553f5f84935908a718644a72965ad40cda81eec381353033633bc2bd1613c4af' 
  AND (
    token = 'e11Vgze2OAzKGg9VnhQXGKV5wKdsJ5XxHXlvBIWv2M8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032