UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sWevoWXsIUWTU0s2FrJY2efrrUbIJgCy6DnD7icE+jc=' 
WHERE 
  key_id = '49fa0f9b8b67e7224eef67b6101fbaff715a7c63b7f2391a4f5d6017f8a19525' 
  AND (
    token = 'sWevoWXsIUWTU0s2FrJY2efrrUbIJgCy6DnD7icE+jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024