UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vn6dNMb0dfB+oRWScE1E0otsTcEidyK+NimOoz7JEDY=' 
WHERE 
  key_id = '10cd30c55ae5600761d0ff7d6e0182693ead4cd2d7d6948b9ae500cb50be71e3' 
  AND (
    token = 'vn6dNMb0dfB+oRWScE1E0otsTcEidyK+NimOoz7JEDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021