UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a//6n9FhjRJXPSjztFZS4DLa5KDLv/dYLD5Z3A1LgXk=' 
WHERE 
  key_id = '04cac6fd0a55f256b6242ce30900e65d7cb0fdca7e9563ab9ddfd0bc9ea33202' 
  AND (
    token = 'a//6n9FhjRJXPSjztFZS4DLa5KDLv/dYLD5Z3A1LgXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068