UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wUwOe0KcJueg6R+EKDrY7Gz2ziBXMNAs8AHCNXfKtEU=' 
WHERE 
  key_id = '93d6e877dd38a39e3902eb21a360796a061ca73d3d00134cdbc21b9a8ed17e3b' 
  AND (
    token = 'wUwOe0KcJueg6R+EKDrY7Gz2ziBXMNAs8AHCNXfKtEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030